﻿@using Nop.Core;
@using Nop.Core.Domain
@using Nop.Core.Infrastructure
@using Nop.Web.Framework.Themes
@using Nop.Web.Framework.UI
@{
    //var supportRtl = EngineContext.Current.Resolve<IWorkContext>().WorkingLanguage.Rtl;
    var storeInfomation = EngineContext.Current.Resolve<StoreInformationSettings>();
    var webHelper = EngineContext.Current.Resolve<IWebHelper>();
    var themeName = EngineContext.Current.Resolve<IThemeContext>().WorkingThemeName;

    //we do not support responsive for RTL yet
    @*if (supportRtl)
        {
            supportResponsive = false;
        }
        //add browser specific CSS files
        var browser = Request.Browser;
        if (browser.Browser == "IE" && browser.MajorVersion == 6)
        {
            Html.AppendCssFileParts(string.Format("~/Themes/{0}/Content/ie6.css", themeName));
        }
        else if (browser.Browser == "IE" && browser.MajorVersion == 7)
        {
            Html.AppendCssFileParts(string.Format("~/Themes/{0}/Content/ie7.css", themeName));
        }
        //responsive design
        if (supportResponsive)
        {
            Html.AppendCssFileParts(string.Format("~/Themes/{0}/Content/responsive.css", themeName));
        }
        //add main CSS file
        if (supportRtl)
        {
            Html.AppendCssFileParts(string.Format("~/Themes/{0}/Content/styles.rtl.css", themeName));
        }
        else
        {
            Html.AppendCssFileParts(string.Format("~/Themes/{0}/Content/styles.css", themeName));
        }
        //responsive design
        if (supportResponsive)
        {
            <meta name="viewport" content="width=device-width, initial-scale=1">
        }*@
    string host = storeInfomation.ThemeResourceCdnDomain;
    
    if (HttpContext.Current.IsDebuggingEnabled)
    {
        Html.AppendScriptParts((string.Format("{0}/{1}/{2}", "http://192.168.1.3:8080", themeName, "package.js")));
        Html.AppendScriptParts((string.Format("{0}/{1}", "http://192.168.1.3:8080", "seajs/enyo.js")));
    }
    else
    {
        Html.AppendCssFileParts(string.Format("{0}Themes/{1}/{2}", host, themeName, "live.css"));
    }
}